package com.nyc.boot.demo05;

import com.nyc.boot.demo02.Cache;
import com.nyc.boot.demo02.Logger;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author niuyicong
 * @date 2025/9/24  10:10:08
 * @description
 */
public class MyImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,BeanDefinitionRegistry registry) {
        RootBeanDefinition logger =new RootBeanDefinition(Logger.class);
        registry.registerBeanDefinition("logger666",logger);
        RootBeanDefinition cache = new RootBeanDefinition(Cache.class);
        registry.registerBeanDefinition("cache111",cache);
    }
}
